/*
 * Copyright (C) 2012-2017 zhuoyue soft Co., Ltd
 * All copyrights reserved by zhuoyue.
 * Any copying, transferring or any other usage is prohibited.
 * Or else, zhuoyue possesses the right to require legal 
 * responsibilities from the violator.
 * All third-party contributions are distributed under license by
 * zhuoyue soft Co., Ltd.
 */
package org.ouniao.jprint.client;

import java.util.concurrent.CountDownLatch;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;

/**
 * 
 * @author tiny
 *
 */
@SpringBootApplication(scanBasePackages = {"org.ouniao.jprint.client"})
@PropertySources({@PropertySource("classpath:activemq.properties")})
public class ClientBootstrap {

	@Bean
	public CountDownLatch closeLatch() {
		return new CountDownLatch(1);
	}

	public static void main(String[] args) {
		ApplicationContext ctx = new SpringApplicationBuilder().sources(ClientBootstrap.class).web(false).run(args);
		CountDownLatch closeLatch = ctx.getBean(CountDownLatch.class);
		try {
			closeLatch.await();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

}
